<?php
include ("includes/iniciaSessio.php");
include ("includes/connection.php");

mysql_select_db("sintesi", $conexion);
echo $email = $_POST['email'];
echo($_SESSION["username"]);

if (isset($_SESSION["sessionID"])) {

	echo $email = $_POST['email'];
	$nom = $_POST['nom'];
	$cog1 = $_POST['cognom1'];
	$cog2 = $_POST['cognom2'];
	$sexe = $_POST['sexe'];
	$data = $_POST['data'];
	$biografia = $_POST['biografia'];
	$user = $_SESSION["username"];
	//cal modificar la data que no funciona be data=$data,
	
	$consulta = "UPDATE usuari SET nomUsuari = '$nom', cognom1 = '$cog1', cognom2 = '$cog2', sexe = '$sexe', telefon = '000000000' WHERE alias = '$user'";

	$result = (mysql_query($consulta, $conexion));

	if ($result) {
		echo "	<script>
							alert('Insertat');
							</script>";

	} else {
		echo "	<script>
							alert('NOOOOOO Insertat');
							</script>";
	}

}
?>

